package com.njym.java.security.app.mapper;


import com.njym.java.security.app.entity.UserRelation;
import com.njym.java.security.app.entity.UserRelationVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 
 * 
 * @author lijie
 * @email 717057076@qq.com
 * @date 2019-11-22 16:44:11
 */

public interface UserRelationMapper extends Mapper<UserRelation> {
    /**
     * 查询好友申请
     * @param userId
     * @return
     */
	List<UserRelationVo> queryFriendApply(@Param("userId") Integer userId);

    /**
     * 同意好友
     * @param userId
     * @param friendId
     * @return
     */
	int updateRelation(@Param("userId") Integer userId, @Param("friendId") Integer friendId);

    /**
     * 拒绝好友
     * @param userId
     * @param friendId
     * @return
     */
    int rejectFriend(@Param("userId") Integer userId, @Param("friendId") Integer friendId);

    List<UserRelation> checkFriend(@Param("userId") Integer userId, @Param("friendId") Integer friendId);
}
